import md5 from 'js-md5'
const $md5 = {
    transferValue:function(params){
        let keys = [];
        let kvStr = '';
        for(let x in params){
          keys.push(x);
        }
        keys.sort();
        keys.forEach((key,index) =>{
          if(index < keys.length -1){
            kvStr += (key+'='+params[key]+'&').toString().toLowerCase()
          }
          else{
            kvStr += (key+'='+params[key]+'&key=fe378856-f4df-4311-beb5-d3fc00b9933b').toString().toLowerCase()
          }
        })
        return kvStr;
    },
    val: function(val) {
        return md5(val).toUpperCase();
    }
}
export default $md5;